﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[CreateAssetMenu(fileName = "New Spell List", menuName = "Game/Spell List")]
public class SpellList : ScriptableObject
{
    public List<SpellData> spellDatas;

    public Dictionary<string, SpellData> SpellDatas { get; private set; }

    private void Awake()
    {
        Debug.Log($"Spell List {name} Awake!");
    }

    private void OnEnable()
    {
        SpellDatas = new Dictionary<string, SpellData>();
        foreach (var spellData in spellDatas)
        {
            SpellDatas.Add(spellData.spellName, spellData);
        }
    }

    private void OnDisable()
    {
        Debug.Log($"Spell List {name} Disable!");
    }

    private void OnDestroy()
    {
        Debug.Log($"Spell List {name} Destory!");
    }
}
